home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / BGRAPHH.HDR < prev    next >
Text File  |  1994-04-25  |  2KB  |  63 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _BarGraphH(TopRow,TopCol,BotRow,BotCol,Degree_Prcnt,Fore_Char,Back_Char,Fore_
  8. Color,Back_Color,Final_Only,Use_Zero) --> NIL
  9.  
  10. PARAMETERS:
  11.  
  12. TopRow        : Top Row (Maximum range) of Bargraph
  13. TopCol        : Top Left Column of Bargraph
  14. BotRow        : Bottom Row (Minimum Range) of Bargraph
  15. BotCol        : Bottom Right Column of Bargraph
  16. Degree_Prcnt  : Percent of Bar to Graph
  17. Fore_Char     : Graph Charcater (what to draw with)
  18. Back_Char     : Background Character (what to draw on)
  19. Fore_color    : ForeGround Color to Use
  20. Back_Color    : background Color to Use
  21. Final_Only    : Logical - Print Whole Bar or just Top Character
  22. Use_Zero      : Locgical - Graph Bottom char if Percent 0 < n < 1
  23.  
  24. SHORT:
  25.  
  26. Provides a horizontal bargraph based upon "percent."
  27.  
  28. DESCRIPTION:
  29.  
  30. _BarGraphH() performs the same thing as _BarGraphV(), but along a
  31. horizontal axis.
  32.  
  33. NOTE:
  34.  
  35. See KLIPPER.CH for alternate calling conventions using #xtrans.
  36.  
  37. EXAMPLE:
  38.  
  39. #define DEGREE  67
  40.  
  41. _Box(1,09,03,71)
  42.  
  43. @ 04,10 say '100 %'+' (' + ltrim(str(DEGREE)) + '% COMPLETE)'
  44. @ 04,24 say ' 75 %'
  45. @ 14,39 say ' 50 %'
  46. @ 14,54 say ' 25 %'
  47. @ 24,68 say '  0 %'
  48.  
  49.  
  50. _BarGraphV(02,10,02,70,DEGREE,'█','░',,'b/n')
  51.  
  52. Result: A graph similar to the following is built:
  53.  
  54. ┌────────────────────────────────────────────────────────────┐
  55. │█████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░│
  56. └────────────────────────────────────────────────────────────┘
  57. 0%            25%            50%            75%           100%
  58.  
  59. Notice that the _BarGraphH() function is responsible only for the
  60. actual bargraph itself.  The box and the labels were drawn manually.
  61.  
  62. ******************************************************************************/
  63.